home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 May: Tool Chest / Dev.CD May 00 TC.toast / pc / tool chest / macapp / macapp r14d5 / install macapp r14d5 / Apple Frameworks / WASTE / Source / WEFontTables.c < prev    next >
MacBinary  |  2000-02-25  |  9.3 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Fri Feb 25 05:00:00 2000, modified Fri Feb 25 05:00:00 2000, creator 'CWIE', type ASCII, 8953 bytes "WEFontTables.c" , at 0x2379 286 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 57 45 46 6f 6e 74 | 54 61 62 6c 65 73 2e 63 |..WEFont|Tables.c|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 22 f9 00 | 00 01 1e b4 dc 03 20 b4 |....."..|...... .|
|00000060| dc 03 20 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.. .....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 33 c3 00 00 |........|....3...|
|00000080| 2f 2a 0d 20 2a 09 57 45 | 46 6f 6e 74 54 61 62 6c |/*. *.WE|FontTabl|
|00000090| 65 73 2e 63 0d 20 2a 0d | 20 2a 09 57 41 53 54 45 |es.c. *.| *.WASTE|
|000000a0| 20 50 52 4f 4a 45 43 54 | 0d 20 2a 20 20 46 6f 6e | PROJECT|. * Fon|
|000000b0| 74 20 4d 61 70 70 69 6e | 67 20 54 61 62 6c 65 73 |t Mappin|g Tables|
|000000c0| 0d 20 2a 0d 20 2a 20 20 | 43 6f 70 79 72 69 67 68 |. *. * |Copyrigh|
|000000d0| 74 20 28 63 29 20 31 39 | 39 33 2d 31 39 39 38 20 |t (c) 19|93-1998 |
|000000e0| 4d 61 72 63 6f 20 50 69 | 6f 76 61 6e 65 6c 6c 69 |Marco Pi|ovanelli|
|000000f0| 0d 20 2a 09 41 6c 6c 20 | 52 69 67 68 74 73 20 52 |. *.All |Rights R|
|00000100| 65 73 65 72 76 65 64 0d | 20 2a 0d 20 2a 20 20 43 |eserved.| *. * C|
|00000110| 20 70 6f 72 74 20 62 79 | 20 44 61 6e 20 43 72 65 | port by| Dan Cre|
|00000120| 76 69 65 72 0d 20 2a 0d | 20 2a 2f 0d 0d 2f 2a 0d |vier. *.| */../*.|
|00000130| 09 50 6f 72 74 69 6f 6e | 73 20 63 6f 70 79 72 69 |.Portion|s copyri|
|00000140| 67 68 74 20 a9 20 31 39 | 39 38 2d 31 39 39 39 20 |ght . 19|98-1999 |
|00000150| 62 79 20 41 70 70 6c 65 | 20 43 6f 6d 70 75 74 65 |by Apple| Compute|
|00000160| 72 2c 20 49 6e 63 2e 20 | 41 6c 6c 20 72 69 67 68 |r, Inc. |All righ|
|00000170| 74 73 20 72 65 73 65 72 | 76 65 64 2e 0d 0d 09 43 |ts reser|ved....C|
|00000180| 68 61 6e 67 65 20 48 69 | 73 74 6f 72 79 3a 0d 09 |hange Hi|story:..|
|00000190| 09 31 31 2f 31 30 2f 39 | 39 09 54 57 42 09 09 43 |.11/10/9|9.TWB..C|
|000001a0| 6c 65 61 6e 20 75 70 20 | 74 68 65 20 70 72 69 76 |lean up |the priv|
|000001b0| 61 74 65 20 69 6e 74 65 | 72 66 61 63 65 73 2e 20 |ate inte|rfaces. |
|000001c0| 0d 2a 2f 0d 0d 0d 23 69 | 6e 63 6c 75 64 65 20 22 |.*/...#i|nclude "|
|000001d0| 57 41 53 54 45 49 6e 74 | 66 2e 68 22 0d 0d 65 6e |WASTEInt|f.h"..en|
|000001e0| 75 6d 0d 7b 0d 09 77 65 | 46 6f 6e 74 54 61 62 6c |um.{..we|FontTabl|
|000001f0| 65 53 69 67 6e 61 74 75 | 72 65 09 09 09 3d 09 27 |eSignatu|re...=.'|
|00000200| 46 49 53 48 27 2c 0d 09 | 77 65 43 75 72 72 65 6e |FISH',..|weCurren|
|00000210| 74 46 6f 6e 74 54 61 62 | 6c 65 56 65 72 73 69 6f |tFontTab|leVersio|
|00000220| 6e 09 09 3d 09 30 78 30 | 31 30 30 38 30 30 30 09 |n..=.0x0|1008000.|
|00000230| 09 2f 2f 09 31 2e 30 0d | 7d 3b 0d 0d 74 79 70 65 |.//.1.0.|};..type|
|00000240| 64 65 66 20 73 74 72 75 | 63 74 0d 7b 0d 09 46 6f |def stru|ct.{..Fo|
|00000250| 75 72 43 68 61 72 43 6f | 64 65 20 66 74 53 69 67 |urCharCo|de ftSig|
|00000260| 6e 61 74 75 72 65 3b 09 | 2f 2f 09 6d 75 73 74 20 |nature;.|//.must |
|00000270| 62 65 20 77 65 46 6f 6e | 74 54 61 62 6c 65 53 69 |be weFon|tTableSi|
|00000280| 67 6e 61 74 75 72 65 0d | 09 55 49 6e 74 33 32 20 |gnature.|.UInt32 |
|00000290| 66 74 56 65 72 73 69 6f | 6e 3b 09 09 09 2f 2f 09 |ftVersio|n;...//.|
|000002a0| 66 6f 6e 74 20 74 61 62 | 6c 65 20 76 65 72 73 69 |font tab|le versi|
|000002b0| 6f 6e 2c 20 69 6e 20 4e | 75 6d 56 65 72 73 69 6f |on, in N|umVersio|
|000002c0| 6e 20 66 6f 72 6d 61 74 | 0d 09 55 49 6e 74 33 32 |n format|..UInt32|
|000002d0| 20 66 74 4e 75 6d 45 6e | 74 72 69 65 73 3b 09 09 | ftNumEn|tries;..|
|000002e0| 2f 2f 09 65 6e 74 72 79 | 20 63 6f 75 6e 74 0d 09 |//.entry| count..|
|000002f0| 55 49 6e 74 33 32 20 66 | 74 52 65 73 65 72 76 65 |UInt32 f|tReserve|
|00000300| 64 3b 09 09 09 2f 2f 09 | 72 65 73 65 72 76 65 64 |d;...//.|reserved|
|00000310| 20 66 6f 72 20 66 75 74 | 75 72 65 20 75 73 65 0d | for fut|ure use.|
|00000320| 7d 20 57 45 46 6f 6e 74 | 54 61 62 6c 65 48 65 61 |} WEFont|TableHea|
|00000330| 64 65 72 2c 20 2a 57 45 | 46 6f 6e 74 54 61 62 6c |der, *WE|FontTabl|
|00000340| 65 48 65 61 64 65 72 50 | 74 72 3b 0d 0d 74 79 70 |eHeaderP|tr;..typ|
|00000350| 65 64 65 66 20 73 74 72 | 75 63 74 0d 7b 0d 09 53 |edef str|uct.{..S|
|00000360| 49 6e 74 31 36 20 66 74 | 4f 6c 64 46 6f 6e 74 49 |Int16 ft|OldFontI|
|00000370| 44 3b 09 09 2f 2f 09 66 | 6f 6e 74 20 49 44 20 6f |D;..//.f|ont ID o|
|00000380| 6e 20 73 61 76 65 0d 09 | 53 49 6e 74 31 36 20 66 |n save..|SInt16 f|
|00000390| 74 4e 65 77 46 6f 6e 74 | 49 44 3b 09 09 2f 2f 09 |tNewFont|ID;..//.|
|000003a0| 66 6f 6e 74 20 49 44 20 | 6f 6e 20 72 65 2d 6f 70 |font ID |on re-op|
|000003b0| 65 6e 0d 09 53 49 6e 74 | 33 32 20 66 74 45 6e 63 |en..SInt|32 ftEnc|
|000003c0| 6f 64 69 6e 67 3b 09 09 | 2f 2f 09 63 68 61 72 61 |oding;..|//.chara|
|000003d0| 63 74 65 72 20 65 6e 63 | 6f 64 69 6e 67 20 28 63 |cter enc|oding (c|
|000003e0| 75 72 72 65 6e 74 6c 79 | 20 3d 20 73 63 72 69 70 |urrently| = scrip|
|000003f0| 74 20 63 6f 64 65 29 0d | 09 53 49 6e 74 33 32 20 |t code).|.SInt32 |
|00000400| 66 74 52 65 73 65 72 76 | 65 64 3b 09 09 2f 2f 09 |ftReserv|ed;..//.|
|00000410| 72 65 73 65 72 76 65 64 | 20 66 6f 72 20 66 75 74 |reserved| for fut|
|00000420| 75 72 65 20 75 73 65 0d | 09 55 49 6e 74 33 32 20 |ure use.|.UInt32 |
|00000430| 66 74 4e 61 6d 65 4f 66 | 66 73 65 74 3b 09 2f 2f |ftNameOf|fset;.//|
|00000440| 09 6f 66 66 73 65 74 20 | 74 6f 20 66 6f 6e 74 20 |.offset |to font |
|00000450| 6e 61 6d 65 0d 7d 20 57 | 45 46 6f 6e 74 54 61 62 |name.} W|EFontTab|
|00000460| 6c 65 45 6e 74 72 79 2c | 20 2a 57 45 46 6f 6e 74 |leEntry,| *WEFont|
|00000470| 54 61 62 6c 65 45 6e 74 | 72 79 50 74 72 3b 0d 0d |TableEnt|ryPtr;..|
|00000480| 74 79 70 65 64 65 66 20 | 73 74 72 75 63 74 20 57 |typedef |struct W|
|00000490| 45 46 6f 6e 74 54 61 62 | 6c 65 0d 7b 0d 09 57 45 |EFontTab|le.{..WE|
|000004a0| 46 6f 6e 74 54 61 62 6c | 65 48 65 61 64 65 72 20 |FontTabl|eHeader |
|000004b0| 66 74 48 65 61 64 65 72 | 3b 0d 09 57 45 46 6f 6e |ftHeader|;..WEFon|
|000004c0| 74 54 61 62 6c 65 45 6e | 74 72 79 20 66 74 45 6e |tTableEn|try ftEn|
|000004d0| 74 72 69 65 73 20 5b 20 | 6b 56 61 72 69 61 62 6c |tries [ |kVariabl|
|000004e0| 65 4c 65 6e 67 74 68 41 | 72 72 61 79 20 5d 3b 0d |eLengthA|rray ];.|
|000004f0| 09 2f 2f 09 70 61 63 6b | 65 64 20 66 6f 6e 74 20 |.//.pack|ed font |
|00000500| 6e 61 6d 65 73 20 66 6f | 6c 6c 6f 77 0d 7d 20 57 |names fo|llow.} W|
|00000510| 45 46 6f 6e 74 54 61 62 | 6c 65 3b 0d 0d 74 79 70 |EFontTab|le;..typ|
|00000520| 65 64 65 66 20 73 74 72 | 75 63 74 20 57 45 46 6f |edef str|uct WEFo|
|00000530| 6e 74 54 61 62 6c 65 20 | 2a 57 45 46 6f 6e 74 54 |ntTable |*WEFontT|
|00000540| 61 62 6c 65 50 74 72 3b | 0d 0d 70 61 73 63 61 6c |ablePtr;|..pascal|
|00000550| 20 4f 53 45 72 72 20 57 | 45 42 75 69 6c 64 46 6f | OSErr W|EBuildFo|
|00000560| 6e 74 54 61 62 6c 65 28 | 57 45 46 6f 6e 74 54 61 |ntTable(|WEFontTa|
|00000570| 62 6c 65 48 61 6e 64 6c | 65 20 68 46 6f 6e 74 54 |bleHandl|e hFontT|
|00000580| 61 62 6c 65 2c 20 57 45 | 46 6f 6e 74 49 44 54 6f |able, WE|FontIDTo|
|00000590| 4e 61 6d 65 55 50 50 20 | 66 6f 6e 74 49 44 54 6f |NameUPP |fontIDTo|
|000005a0| 4e 61 6d 65 50 72 6f 63 | 2c 20 57 45 48 61 6e 64 |NameProc|, WEHand|
|000005b0| 6c 65 20 68 57 45 29 0d | 7b 0d 09 48 61 6e 64 6c |le hWE).|{..Handl|
|000005c0| 65 20 68 53 74 79 6c 65 | 73 20 3d 20 6e 69 6c 3b |e hStyle|s = nil;|
|000005d0| 0d 09 57 45 53 74 79 6c | 65 54 61 62 6c 65 45 6e |..WEStyl|eTableEn|
|000005e0| 74 72 79 20 2a 70 53 74 | 79 6c 65 2c 20 2a 70 53 |try *pSt|yle, *pS|
|000005f0| 74 79 6c 65 32 3b 0d 09 | 57 45 46 6f 6e 74 54 61 |tyle2;..|WEFontTa|
|00000600| 62 6c 65 50 74 72 20 70 | 46 6f 6e 74 54 61 62 6c |blePtr p|FontTabl|
|00000610| 65 3b 0d 09 53 49 6e 74 | 33 32 20 6e 53 74 79 6c |e;..SInt|32 nStyl|
|00000620| 65 73 2c 20 73 74 79 6c | 65 49 6e 64 65 78 2c 20 |es, styl|eIndex, |
|00000630| 73 74 79 6c 65 49 6e 64 | 65 78 32 3b 0d 09 57 45 |styleInd|ex2;..WE|
|00000640| 46 6f 6e 74 54 61 62 6c | 65 45 6e 74 72 79 20 65 |FontTabl|eEntry e|
|00000650| 6e 74 72 79 3b 0d 09 57 | 45 46 6f 6e 74 54 61 62 |ntry;..W|EFontTab|
|00000660| 6c 65 45 6e 74 72 79 50 | 74 72 20 70 45 6e 74 72 |leEntryP|tr pEntr|
|00000670| 79 3b 0d 09 53 74 72 32 | 35 35 20 66 6f 6e 74 4e |y;..Str2|55 fontN|
|00000680| 61 6d 65 3b 0d 09 53 49 | 6e 74 33 32 20 66 6f 6e |ame;..SI|nt32 fon|
|00000690| 74 43 6f 75 6e 74 3b 0d | 09 53 49 6e 74 33 32 20 |tCount;.|.SInt32 |
|000006a0| 66 6f 6e 74 4e 61 6d 65 | 4f 66 66 73 65 74 3b 0d |fontName|Offset;.|
|000006b0| 09 53 69 7a 65 20 66 6f | 6e 74 4e 61 6d 65 53 69 |.Size fo|ntNameSi|
|000006c0| 7a 65 2c 20 6f 66 66 73 | 65 74 41 64 6a 75 73 74 |ze, offs|etAdjust|
|000006d0| 6d 65 6e 74 3b 0d 09 42 | 6f 6f 6c 65 61 6e 20 73 |ment;..B|oolean s|
|000006e0| 61 76 65 53 74 79 6c 65 | 73 4c 6f 63 6b 3b 0d 09 |aveStyle|sLock;..|
|000006f0| 4f 53 45 72 72 20 65 72 | 72 3b 0d 0d 09 2f 2f 09 |OSErr er|r;...//.|
|00000700| 72 65 74 75 72 6e 20 61 | 6e 20 65 72 72 6f 72 20 |return a|n error |
|00000710| 63 6f 64 65 20 69 73 20 | 68 46 6f 6e 74 54 61 62 |code is |hFontTab|
|00000720| 6c 65 20 69 73 20 6e 69 | 6c 0d 09 65 72 72 20 3d |le is ni|l..err =|
|00000730| 20 6e 69 6c 48 61 6e 64 | 6c 65 45 72 72 3b 0d 09 | nilHand|leErr;..|
|00000740| 69 66 20 28 68 46 6f 6e | 74 54 61 62 6c 65 20 3d |if (hFon|tTable =|
|00000750| 3d 20 6e 69 6c 29 0d 09 | 7b 0d 09 09 67 6f 74 6f |= nil)..|{...goto|
|00000760| 20 63 6c 65 61 6e 75 70 | 3b 0d 09 7d 0d 0d 09 2f | cleanup|;..}.../|
|00000770| 2f 09 63 6c 6f 6e 65 20 | 74 68 65 20 73 74 79 6c |/.clone |the styl|
|00000780| 65 20 74 61 62 6c 65 2c | 20 61 73 20 77 65 20 6e |e table,| as we n|
|00000790| 65 65 64 20 61 20 6d 6f | 64 69 66 69 61 62 6c 65 |eed a mo|difiable|
|000007a0| 20 63 6f 70 79 0d 09 68 | 53 74 79 6c 65 73 20 3d | copy..h|Styles =|
|000007b0| 20 28 48 61 6e 64 6c 65 | 29 20 28 2a 68 57 45 29 | (Handle|) (*hWE)|
|000007c0| 2d 3e 68 53 74 79 6c 65 | 73 3b 0d 09 69 66 20 28 |->hStyle|s;..if (|
|000007d0| 28 65 72 72 20 3d 20 48 | 61 6e 64 54 6f 48 61 6e |(err = H|andToHan|
|000007e0| 64 28 26 68 53 74 79 6c | 65 73 29 29 20 21 3d 20 |d(&hStyl|es)) != |
|000007f0| 6e 6f 45 72 72 29 0d 09 | 7b 0d 09 09 68 53 74 79 |noErr)..|{...hSty|
|00000800| 6c 65 73 20 3d 20 6e 69 | 6c 3b 0d 09 09 67 6f 74 |les = ni|l;...got|
|00000810| 6f 20 63 6c 65 61 6e 75 | 70 3b 0d 09 7d 0d 0d 09 |o cleanu|p;..}...|
|00000820| 2f 2f 09 6c 6f 63 6b 20 | 74 68 65 20 73 74 79 6c |//.lock |the styl|
|00000830| 65 20 74 61 62 6c 65 0d | 09 73 61 76 65 53 74 79 |e table.|.saveSty|
|00000840| 6c 65 73 4c 6f 63 6b 20 | 3d 20 5f 57 45 53 65 74 |lesLock |= _WESet|
|00000850| 48 61 6e 64 6c 65 4c 6f | 63 6b 28 68 53 74 79 6c |HandleLo|ck(hStyl|
|00000860| 65 73 2c 20 74 72 75 65 | 29 3b 0d 0d 09 2f 2f 09 |es, true|);...//.|
|00000870| 66 69 6c 6c 20 69 6e 20 | 66 6f 6e 74 20 74 61 62 |fill in |font tab|
|00000880| 6c 65 20 68 65 61 64 65 | 72 0d 09 53 65 74 48 61 |le heade|r..SetHa|
|00000890| 6e 64 6c 65 53 69 7a 65 | 28 28 48 61 6e 64 6c 65 |ndleSize|((Handle|
|000008a0| 29 68 46 6f 6e 74 54 61 | 62 6c 65 2c 20 73 69 7a |)hFontTa|ble, siz|
|000008b0| 65 6f 66 28 57 45 46 6f | 6e 74 54 61 62 6c 65 48 |eof(WEFo|ntTableH|
|000008c0| 65 61 64 65 72 29 29 3b | 0d 09 69 66 20 28 28 65 |eader));|..if ((e|
|000008d0| 72 72 20 3d 20 4d 65 6d | 45 72 72 6f 72 28 29 29 |rr = Mem|Error())|
|000008e0| 20 21 3d 20 6e 6f 45 72 | 72 29 0d 09 7b 0d 09 09 | != noEr|r)..{...|
|000008f0| 67 6f 74 6f 20 63 6c 65 | 61 6e 75 70 3b 0d 09 7d |goto cle|anup;..}|
|00000900| 0d 09 70 46 6f 6e 74 54 | 61 62 6c 65 20 3d 20 2a |..pFontT|able = *|
|00000910| 68 46 6f 6e 74 54 61 62 | 6c 65 3b 0d 09 5f 57 45 |hFontTab|le;.._WE|
|00000920| 42 6c 6f 63 6b 43 6c 72 | 28 70 46 6f 6e 74 54 61 |BlockClr|(pFontTa|
|00000930| 62 6c 65 2c 20 73 69 7a | 65 6f 66 28 57 45 46 6f |ble, siz|eof(WEFo|
|00000940| 6e 74 54 61 62 6c 65 48 | 65 61 64 65 72 29 29 3b |ntTableH|eader));|
|00000950| 0d 09 70 46 6f 6e 74 54 | 61 62 6c 65 2d 3e 66 74 |..pFontT|able->ft|
|00000960| 48 65 61 64 65 72 2e 66 | 74 53 69 67 6e 61 74 75 |Header.f|tSignatu|
|00000970| 72 65 20 3d 20 77 65 46 | 6f 6e 74 54 61 62 6c 65 |re = weF|ontTable|
|00000980| 53 69 67 6e 61 74 75 72 | 65 3b 0d 09 70 46 6f 6e |Signatur|e;..pFon|
|00000990| 74 54 61 62 6c 65 2d 3e | 66 74 48 65 61 64 65 72 |tTable->|ftHeader|
|000009a0| 2e 66 74 56 65 72 73 69 | 6f 6e 20 3d 20 77 65 43 |.ftVersi|on = weC|
|000009b0| 75 72 72 65 6e 74 46 6f | 6e 74 54 61 62 6c 65 56 |urrentFo|ntTableV|
|000009c0| 65 72 73 69 6f 6e 3b 0d | 0d 09 2f 2f 09 69 6e 69 |ersion;.|..//.ini|
|000009d0| 74 20 63 6f 75 6e 74 65 | 72 73 0d 09 66 6f 6e 74 |t counte|rs..font|
|000009e0| 43 6f 75 6e 74 20 3d 20 | 30 3b 0d 09 66 6f 6e 74 |Count = |0;..font|
|000009f0| 4e 61 6d 65 4f 66 66 73 | 65 74 20 3d 20 73 69 7a |NameOffs|et = siz|
|00000a00| 65 6f 66 28 57 45 46 6f | 6e 74 54 61 62 6c 65 48 |eof(WEFo|ntTableH|
|00000a10| 65 61 64 65 72 29 3b 0d | 0d 09 2f 2f 09 77 61 6c |eader);.|..//.wal|
|00000a20| 6b 20 74 68 65 20 73 74 | 79 6c 65 20 74 61 62 6c |k the st|yle tabl|
|00000a30| 65 0d 09 6e 53 74 79 6c | 65 73 20 3d 20 28 2a 68 |e..nStyl|es = (*h|
|00000a40| 57 45 29 2d 3e 6e 53 74 | 79 6c 65 73 3b 0d 09 66 |WE)->nSt|yles;..f|
|00000a50| 6f 72 20 28 09 73 74 79 | 6c 65 49 6e 64 65 78 20 |or (.sty|leIndex |
|00000a60| 3d 20 30 2c 0d 09 09 09 | 70 53 74 79 6c 65 20 3d |= 0,....|pStyle =|
|00000a70| 20 28 57 45 53 74 79 6c | 65 54 61 62 6c 65 45 6e | (WEStyl|eTableEn|
|00000a80| 74 72 79 20 2a 29 20 2a | 68 53 74 79 6c 65 73 3b |try *) *|hStyles;|
|00000a90| 0d 09 09 09 73 74 79 6c | 65 49 6e 64 65 78 20 3c |....styl|eIndex <|
|00000aa0| 20 6e 53 74 79 6c 65 73 | 3b 0d 09 09 09 73 74 79 | nStyles|;....sty|
|00000ab0| 6c 65 49 6e 64 65 78 2b | 2b 2c 20 70 53 74 79 6c |leIndex+|+, pStyl|
|00000ac0| 65 2b 2b 20 29 0d 09 7b | 0d 09 09 2f 2f 09 73 6b |e++ )..{|...//.sk|
|00000ad0| 69 70 20 74 68 69 73 20 | 73 74 79 6c 65 20 74 61 |ip this |style ta|
|00000ae0| 62 6c 65 20 65 6e 74 72 | 79 20 69 66 20 69 74 27 |ble entr|y if it'|
|00000af0| 73 20 65 69 74 68 65 72 | 20 75 6e 75 73 65 64 0d |s either| unused.|
|00000b00| 09 09 2f 2f 09 6f 72 20 | 69 74 20 72 65 66 65 72 |..//.or |it refer|
|00000b10| 65 6e 63 65 73 20 61 20 | 66 6f 6e 74 20 77 65 20 |ences a |font we |
|00000b20| 68 61 76 65 20 61 6c 72 | 65 61 64 79 20 70 72 6f |have alr|eady pro|
|00000b30| 63 65 73 73 65 64 0d 09 | 09 69 66 20 28 70 53 74 |cessed..|.if (pSt|
|00000b40| 79 6c 65 2d 3e 72 65 66 | 43 6f 75 6e 74 20 3d 3d |yle->ref|Count ==|
|00000b50| 20 30 29 0d 09 09 7b 0d | 09 09 09 63 6f 6e 74 69 | 0)...{.|...conti|
|00000b60| 6e 75 65 3b 0d 09 09 7d | 0d 0d 09 09 2f 2f 09 67 |nue;...}|....//.g|
|00000b70| 65 74 20 74 68 65 20 6e | 61 6d 65 20 6f 66 20 74 |et the n|ame of t|
|00000b80| 68 69 73 20 66 6f 6e 74 | 0d 09 09 42 4c 4f 43 4b |his font|...BLOCK|
|00000b90| 5f 43 4c 52 28 66 6f 6e | 74 4e 61 6d 65 29 3b 0d |_CLR(fon|tName);.|
|00000ba0| 09 09 47 65 74 46 6f 6e | 74 4e 61 6d 65 28 70 53 |..GetFon|tName(pS|
|00000bb0| 74 79 6c 65 2d 3e 69 6e | 66 6f 2e 72 75 6e 53 74 |tyle->in|fo.runSt|
|00000bc0| 79 6c 65 2e 74 73 46 6f | 6e 74 2c 20 66 6f 6e 74 |yle.tsFo|nt, font|
|00000bd0| 4e 61 6d 65 29 3b 0d 0d | 09 09 2f 2f 09 63 61 6c |Name);..|..//.cal|
|00000be0| 6c 65 72 20 63 61 6e 20 | 63 75 73 74 6f 6d 69 7a |ler can |customiz|
|00000bf0| 65 20 74 68 65 20 62 75 | 69 6c 64 69 6e 67 20 70 |e the bu|ilding p|
|00000c00| 72 6f 63 65 73 73 20 62 | 79 20 73 75 70 70 6c 79 |rocess b|y supply|
|00000c10| 69 6e 67 0d 09 09 2f 2f | 09 61 20 6d 61 70 70 69 |ing...//|.a mappi|
|00000c20| 6e 67 20 66 75 6e 63 74 | 69 6f 6e 0d 09 09 69 66 |ng funct|ion...if|
|00000c30| 20 28 66 6f 6e 74 49 44 | 54 6f 4e 61 6d 65 50 72 | (fontID|ToNamePr|
|00000c40| 6f 63 20 21 3d 20 6e 69 | 6c 29 0d 09 09 7b 0d 09 |oc != ni|l)...{..|
|00000c50| 09 09 69 66 20 28 28 65 | 72 72 20 3d 20 43 61 6c |..if ((e|rr = Cal|
|00000c60| 6c 57 45 46 6f 6e 74 49 | 44 54 6f 4e 61 6d 65 50 |lWEFontI|DToNameP|
|00000c70| 72 6f 63 28 70 53 74 79 | 6c 65 2d 3e 69 6e 66 6f |roc(pSty|le->info|
|00000c80| 2e 72 75 6e 53 74 79 6c | 65 2e 74 73 46 6f 6e 74 |.runStyl|e.tsFont|
|00000c90| 2c 20 66 6f 6e 74 4e 61 | 6d 65 2c 20 66 6f 6e 74 |, fontNa|me, font|
|00000ca0| 49 44 54 6f 4e 61 6d 65 | 50 72 6f 63 29 29 20 21 |IDToName|Proc)) !|
|00000cb0| 3d 20 6e 6f 45 72 72 29 | 0d 09 09 09 7b 0d 09 09 |= noErr)|....{...|
|00000cc0| 09 09 67 6f 74 6f 20 63 | 6c 65 61 6e 75 70 3b 0d |..goto c|leanup;.|
|00000cd0| 09 09 09 7d 0d 09 09 7d | 0d 0d 09 09 2f 2f 09 63 |...}...}|....//.c|
|00000ce0| 61 6c 63 75 6c 61 74 65 | 20 74 68 65 20 73 70 61 |alculate| the spa|
|00000cf0| 63 65 20 6e 65 65 64 65 | 64 20 62 79 20 74 68 65 |ce neede|d by the|
|00000d00| 20 66 6f 6e 74 20 6e 61 | 6d 65 0d 09 09 2f 2f 09 | font na|me...//.|
|00000d10| 66 6f 72 20 6f 70 74 69 | 6d 61 6c 20 61 6c 69 67 |for opti|mal alig|
|00000d20| 6e 6d 65 6e 74 2c 20 6d | 61 6b 65 20 73 75 72 65 |nment, m|ake sure|
|00000d30| 20 69 74 27 73 20 61 20 | 6d 75 6c 74 69 70 6c 65 | it's a |multiple|
|00000d40| 20 6f 66 20 34 0d 09 09 | 66 6f 6e 74 4e 61 6d 65 | of 4...|fontName|
|00000d50| 53 69 7a 65 20 3d 20 53 | 74 72 4c 65 6e 67 74 68 |Size = S|trLength|
|00000d60| 28 66 6f 6e 74 4e 61 6d | 65 29 20 2b 20 34 3b 0d |(fontNam|e) + 4;.|
|00000d70| 09 09 66 6f 6e 74 4e 61 | 6d 65 53 69 7a 65 20 26 |..fontNa|meSize &|
|00000d80| 3d 20 7e 33 3b 0d 0d 09 | 09 2f 2f 09 61 70 70 65 |= ~3;...|.//.appe|
|00000d90| 6e 64 20 66 6f 6e 74 20 | 6e 61 6d 65 20 61 74 20 |nd font |name at |
|00000da0| 74 68 65 20 65 6e 64 20 | 6f 66 20 74 68 65 20 66 |the end |of the f|
|00000db0| 6f 6e 74 20 74 61 62 6c | 65 0d 09 09 69 66 20 28 |ont tabl|e...if (|
|00000dc0| 28 65 72 72 20 3d 20 5f | 57 45 53 70 6c 69 63 65 |(err = _|WESplice|
|00000dd0| 28 28 48 61 6e 64 6c 65 | 29 68 46 6f 6e 74 54 61 |((Handle|)hFontTa|
|00000de0| 62 6c 65 2c 20 66 6f 6e | 74 4e 61 6d 65 2c 20 66 |ble, fon|tName, f|
|00000df0| 6f 6e 74 4e 61 6d 65 53 | 69 7a 65 2c 20 2d 31 29 |ontNameS|ize, -1)|
|00000e00| 29 20 21 3d 20 6e 6f 45 | 72 72 29 0d 09 09 7b 0d |) != noE|rr)...{.|
|00000e10| 09 09 09 67 6f 74 6f 20 | 63 6c 65 61 6e 75 70 3b |...goto |cleanup;|
|00000e20| 0d 09 09 7d 0d 0d 09 09 | 2f 2f 09 63 72 65 61 74 |...}....|//.creat|
|00000e30| 65 20 61 20 6e 65 77 20 | 66 6f 6e 74 20 74 61 62 |e a new |font tab|
|00000e40| 6c 65 20 65 6e 74 72 79 | 20 66 6f 72 20 74 68 69 |le entry| for thi|
|00000e50| 73 20 66 6f 6e 74 0d 09 | 09 42 4c 4f 43 4b 5f 43 |s font..|.BLOCK_C|
|00000e60| 4c 52 28 65 6e 74 72 79 | 29 3b 0d 09 09 65 6e 74 |LR(entry|);...ent|
|00000e70| 72 79 2e 66 74 4e 65 77 | 46 6f 6e 74 49 44 20 3d |ry.ftNew|FontID =|
|00000e80| 20 65 6e 74 72 79 2e 66 | 74 4f 6c 64 46 6f 6e 74 | entry.f|tOldFont|
|00000e90| 49 44 20 3d 20 70 53 74 | 79 6c 65 2d 3e 69 6e 66 |ID = pSt|yle->inf|
|00000ea0| 6f 2e 72 75 6e 53 74 79 | 6c 65 2e 74 73 46 6f 6e |o.runSty|le.tsFon|
|00000eb0| 74 3b 0d 09 09 65 6e 74 | 72 79 2e 66 74 45 6e 63 |t;...ent|ry.ftEnc|
|00000ec0| 6f 64 69 6e 67 20 3d 20 | 46 6f 6e 74 54 6f 53 63 |oding = |FontToSc|
|00000ed0| 72 69 70 74 28 65 6e 74 | 72 79 2e 66 74 4f 6c 64 |ript(ent|ry.ftOld|
|00000ee0| 46 6f 6e 74 49 44 29 3b | 0d 09 09 65 6e 74 72 79 |FontID);|...entry|
|00000ef0| 2e 66 74 4e 61 6d 65 4f | 66 66 73 65 74 20 3d 20 |.ftNameO|ffset = |
|00000f00| 66 6f 6e 74 4e 61 6d 65 | 4f 66 66 73 65 74 3b 0d |fontName|Offset;.|
|00000f10| 09 09 66 6f 6e 74 4e 61 | 6d 65 4f 66 66 73 65 74 |..fontNa|meOffset|
|00000f20| 20 2b 3d 20 66 6f 6e 74 | 4e 61 6d 65 53 69 7a 65 | += font|NameSize|
|00000f30| 3b 0d 0d 09 09 2f 2f 09 | 61 64 64 20 61 20 6e 65 |;....//.|add a ne|
|00000f40| 77 20 65 6e 74 72 79 20 | 74 6f 20 74 68 65 20 66 |w entry |to the f|
|00000f50| 6f 6e 74 20 74 61 62 6c | 65 0d 09 09 70 46 6f 6e |ont tabl|e...pFon|
|00000f60| 74 54 61 62 6c 65 20 3d | 20 2a 68 46 6f 6e 74 54 |tTable =| *hFontT|
|00000f70| 61 62 6c 65 3b 0d 09 09 | 69 66 20 28 28 65 72 72 |able;...|if ((err|
|00000f80| 20 3d 20 5f 57 45 53 70 | 6c 69 63 65 28 28 48 61 | = _WESp|lice((Ha|
|00000f90| 6e 64 6c 65 29 68 46 6f | 6e 74 54 61 62 6c 65 2c |ndle)hFo|ntTable,|
|00000fa0| 20 26 65 6e 74 72 79 2c | 20 73 69 7a 65 6f 66 28 | &entry,| sizeof(|
|00000fb0| 65 6e 74 72 79 29 2c 0d | 09 09 09 09 73 69 7a 65 |entry),.|....size|
|00000fc0| 6f 66 28 57 45 46 6f 6e | 74 54 61 62 6c 65 48 65 |of(WEFon|tTableHe|
|00000fd0| 61 64 65 72 29 20 2b 20 | 73 69 7a 65 6f 66 28 57 |ader) + |sizeof(W|
|00000fe0| 45 46 6f 6e 74 54 61 62 | 6c 65 45 6e 74 72 79 29 |EFontTab|leEntry)|
|00000ff0| 20 2a 20 66 6f 6e 74 43 | 6f 75 6e 74 29 29 20 21 | * fontC|ount)) !|
|00001000| 3d 20 6e 6f 45 72 72 29 | 0d 09 09 7b 0d 09 09 09 |= noErr)|...{....|
|00001010| 67 6f 74 6f 20 63 6c 65 | 61 6e 75 70 3b 0d 09 09 |goto cle|anup;...|
|00001020| 7d 0d 09 09 66 6f 6e 74 | 43 6f 75 6e 74 2b 2b 3b |}...font|Count++;|
|00001030| 0d 0d 09 09 2f 2f 09 6d | 61 72 6b 20 61 6c 6c 20 |....//.m|ark all |
|00001040| 72 65 6d 61 69 6e 69 6e | 67 20 65 6e 74 72 69 65 |remainin|g entrie|
|00001050| 73 20 69 6e 20 74 68 65 | 20 73 74 79 6c 65 20 74 |s in the| style t|
|00001060| 61 62 6c 65 20 77 68 69 | 63 68 20 72 65 66 65 72 |able whi|ch refer|
|00001070| 65 6e 63 65 0d 09 09 2f | 2f 09 74 68 65 20 66 6f |ence.../|/.the fo|
|00001080| 6e 74 20 49 44 20 77 65 | 20 68 61 76 65 20 6a 75 |nt ID we| have ju|
|00001090| 73 74 20 70 72 6f 63 65 | 73 73 65 64 2c 20 73 6f |st proce|ssed, so|
|000010a0| 20 74 68 61 74 20 77 65 | 27 6c 6c 20 73 6b 69 70 | that we|'ll skip|
|000010b0| 20 74 68 65 6d 0d 09 09 | 66 6f 72 20 28 20 09 73 | them...|for ( .s|
|000010c0| 74 79 6c 65 49 6e 64 65 | 78 32 20 3d 20 73 74 79 |tyleInde|x2 = sty|
|000010d0| 6c 65 49 6e 64 65 78 20 | 2b 20 31 2c 20 70 53 74 |leIndex |+ 1, pSt|
|000010e0| 79 6c 65 32 20 3d 20 70 | 53 74 79 6c 65 20 2b 20 |yle2 = p|Style + |
|000010f0| 31 3b 0d 09 09 09 09 73 | 74 79 6c 65 49 6e 64 65 |1;.....s|tyleInde|
|00001100| 78 32 20 3c 20 6e 53 74 | 79 6c 65 73 3b 0d 09 09 |x2 < nSt|yles;...|
|00001110| 09 09 73 74 79 6c 65 49 | 6e 64 65 78 32 2b 2b 2c |..styleI|ndex2++,|
|00001120| 20 70 53 74 79 6c 65 32 | 2b 2b 20 29 0d 09 09 7b | pStyle2|++ )...{|
|00001130| 0d 09 09 09 69 66 20 28 | 70 53 74 79 6c 65 32 2d |....if (|pStyle2-|
|00001140| 3e 69 6e 66 6f 2e 72 75 | 6e 53 74 79 6c 65 2e 74 |>info.ru|nStyle.t|
|00001150| 73 46 6f 6e 74 20 3d 3d | 20 65 6e 74 72 79 2e 66 |sFont ==| entry.f|
|00001160| 74 4f 6c 64 46 6f 6e 74 | 49 44 29 0d 09 09 09 7b |tOldFont|ID)....{|
|00001170| 0d 09 09 09 09 70 53 74 | 79 6c 65 32 2d 3e 72 65 |.....pSt|yle2->re|
|00001180| 66 43 6f 75 6e 74 20 3d | 20 30 3b 0d 09 09 09 7d |fCount =| 0;....}|
|00001190| 0d 09 09 7d 0d 09 7d 09 | 2f 2f 20 66 6f 72 0d 0d |...}..}.|// for..|
|000011a0| 09 2f 2f 09 73 61 76 65 | 20 66 6f 6e 74 20 63 6f |.//.save| font co|
|000011b0| 75 6e 74 20 69 6e 20 66 | 6f 6e 74 20 74 61 62 6c |unt in f|ont tabl|
|000011c0| 65 20 68 65 61 64 65 72 | 0d 09 70 46 6f 6e 74 54 |e header|..pFontT|
|000011d0| 61 62 6c 65 20 3d 20 2a | 68 46 6f 6e 74 54 61 62 |able = *|hFontTab|
|000011e0| 6c 65 3b 0d 09 70 46 6f | 6e 74 54 61 62 6c 65 2d |le;..pFo|ntTable-|
|000011f0| 3e 66 74 48 65 61 64 65 | 72 2e 66 74 4e 75 6d 45 |>ftHeade|r.ftNumE|
|00001200| 6e 74 72 69 65 73 20 3d | 20 66 6f 6e 74 43 6f 75 |ntries =| fontCou|
|00001210| 6e 74 3b 0d 0d 09 2f 2f | 09 61 64 6a 75 73 74 20 |nt;...//|.adjust |
|00001220| 6e 61 6d 65 20 6f 66 66 | 73 65 74 73 20 69 6e 20 |name off|sets in |
|00001230| 74 68 65 20 66 6f 6e 74 | 20 74 61 62 6c 65 0d 09 |the font| table..|
|00001240| 6f 66 66 73 65 74 41 64 | 6a 75 73 74 6d 65 6e 74 |offsetAd|justment|
|00001250| 20 3d 20 73 69 7a 65 6f | 66 28 57 45 46 6f 6e 74 | = sizeo|f(WEFont|
|00001260| 54 61 62 6c 65 45 6e 74 | 72 79 29 20 2a 20 66 6f |TableEnt|ry) * fo|
|00001270| 6e 74 43 6f 75 6e 74 3b | 0d 09 66 6f 72 20 28 09 |ntCount;|..for (.|
|00001280| 70 45 6e 74 72 79 20 3d | 20 26 70 46 6f 6e 74 54 |pEntry =| &pFontT|
|00001290| 61 62 6c 65 2d 3e 66 74 | 45 6e 74 72 69 65 73 5b |able->ft|Entries[|
|000012a0| 30 5d 3b 0d 09 09 09 66 | 6f 6e 74 43 6f 75 6e 74 |0];....f|ontCount|
|000012b0| 20 3e 20 30 3b 0d 09 09 | 09 66 6f 6e 74 43 6f 75 | > 0;...|.fontCou|
|000012c0| 6e 74 2d 2d 2c 20 70 45 | 6e 74 72 79 2b 2b 20 29 |nt--, pE|ntry++ )|
|000012d0| 0d 09 7b 0d 09 09 70 45 | 6e 74 72 79 2d 3e 66 74 |..{...pE|ntry->ft|
|000012e0| 4e 61 6d 65 4f 66 66 73 | 65 74 20 2b 3d 20 6f 66 |NameOffs|et += of|
|000012f0| 66 73 65 74 41 64 6a 75 | 73 74 6d 65 6e 74 3b 0d |fsetAdju|stment;.|
|00001300| 09 7d 0d 0d 09 2f 2f 09 | 63 6c 65 61 72 20 72 65 |.}...//.|clear re|
|00001310| 73 75 6c 74 20 63 6f 64 | 65 0d 09 65 72 72 20 3d |sult cod|e..err =|
|00001320| 20 6e 6f 45 72 72 3b 0d | 0d 63 6c 65 61 6e 75 70 | noErr;.|.cleanup|
|00001330| 3a 0d 09 5f 57 45 46 6f | 72 67 65 74 48 61 6e 64 |:.._WEFo|rgetHand|
|00001340| 6c 65 28 26 68 53 74 79 | 6c 65 73 29 3b 0d 0d 09 |le(&hSty|les);...|
|00001350| 2f 2f 09 72 65 74 75 72 | 6e 20 72 65 73 75 6c 74 |//.retur|n result|
|00001360| 20 63 6f 64 65 0d 09 72 | 65 74 75 72 6e 20 65 72 | code..r|eturn er|
|00001370| 72 3b 0d 7d 0d 0d 70 61 | 73 63 61 6c 20 4f 53 45 |r;.}..pa|scal OSE|
|00001380| 72 72 20 57 45 55 70 64 | 61 74 65 46 6f 6e 74 54 |rr WEUpd|ateFontT|
|00001390| 61 62 6c 65 28 57 45 46 | 6f 6e 74 54 61 62 6c 65 |able(WEF|ontTable|
|000013a0| 48 61 6e 64 6c 65 20 68 | 46 6f 6e 74 54 61 62 6c |Handle h|FontTabl|
|000013b0| 65 2c 20 57 45 46 6f 6e | 74 4e 61 6d 65 54 6f 49 |e, WEFon|tNameToI|
|000013c0| 44 55 50 50 20 66 6f 6e | 74 4e 61 6d 65 54 6f 49 |DUPP fon|tNameToI|
|000013d0| 44 50 72 6f 63 2c 20 42 | 6f 6f 6c 65 61 6e 20 2a |DProc, B|oolean *|
|000013e0| 77 61 73 43 68 61 6e 67 | 65 64 29 0d 7b 0d 09 57 |wasChang|ed).{..W|
|000013f0| 45 46 6f 6e 74 54 61 62 | 6c 65 50 74 72 20 70 46 |EFontTab|lePtr pF|
|00001400| 6f 6e 74 54 61 62 6c 65 | 3b 0d 09 57 45 46 6f 6e |ontTable|;..WEFon|
|00001410| 74 54 61 62 6c 65 45 6e | 74 72 79 50 74 72 20 70 |tTableEn|tryPtr p|
|00001420| 45 6e 74 72 79 3b 0d 09 | 43 6f 6e 73 74 53 74 72 |Entry;..|ConstStr|
|00001430| 32 35 35 50 61 72 61 6d | 20 66 6f 6e 74 4e 61 6d |255Param| fontNam|
|00001440| 65 3b 0d 09 53 69 7a 65 | 20 66 6f 6e 74 54 61 62 |e;..Size| fontTab|
|00001450| 6c 65 53 69 7a 65 3b 0d | 09 53 49 6e 74 33 32 20 |leSize;.|.SInt32 |
|00001460| 66 6f 6e 74 43 6f 75 6e | 74 3b 0d 09 53 74 72 32 |fontCoun|t;..Str2|
|00001470| 35 35 20 73 79 73 74 65 | 6d 46 6f 6e 74 4e 61 6d |55 syste|mFontNam|
|00001480| 65 3b 0d 09 42 6f 6f 6c | 65 61 6e 20 73 61 76 65 |e;..Bool|ean save|
|00001490| 46 6f 6e 74 54 61 62 6c | 65 4c 6f 63 6b 20 3d 20 |FontTabl|eLock = |
|000014a0| 66 61 6c 73 65 3b 0d 09 | 42 6f 6f 6c 65 61 6e 20 |false;..|Boolean |
|000014b0| 63 68 61 6e 67 65 64 20 | 3d 20 66 61 6c 73 65 3b |changed |= false;|
|000014c0| 09 2f 2f 09 61 73 73 75 | 6d 65 20 66 6f 6e 74 20 |.//.assu|me font |
|000014d0| 74 61 62 6c 65 20 77 6f | 6e 27 74 20 63 68 61 6e |table wo|n't chan|
|000014e0| 67 65 0d 09 4f 53 45 72 | 72 20 65 72 72 3b 0d 0d |ge..OSEr|r err;..|
|000014f0| 09 2f 2f 09 72 65 74 75 | 72 6e 20 61 6e 20 65 72 |.//.retu|rn an er|
|00001500| 72 6f 72 20 63 6f 64 65 | 20 69 73 20 68 46 6f 6e |ror code| is hFon|
|00001510| 74 54 61 62 6c 65 20 69 | 73 20 6e 69 6c 0d 09 65 |tTable i|s nil..e|
|00001520| 72 72 20 3d 20 6e 69 6c | 48 61 6e 64 6c 65 45 72 |rr = nil|HandleEr|
|00001530| 72 3b 0d 09 69 66 20 28 | 68 46 6f 6e 74 54 61 62 |r;..if (|hFontTab|
|00001540| 6c 65 20 3d 3d 20 6e 69 | 6c 29 0d 09 7b 0d 09 09 |le == ni|l)..{...|
|00001550| 67 6f 74 6f 20 63 6c 65 | 61 6e 75 70 3b 0d 09 7d |goto cle|anup;..}|
|00001560| 0d 0d 09 2f 2f 09 6c 6f | 63 6b 20 74 68 65 20 66 |...//.lo|ck the f|
|00001570| 6f 6e 74 20 74 61 62 6c | 65 0d 09 73 61 76 65 46 |ont tabl|e..saveF|
|00001580| 6f 6e 74 54 61 62 6c 65 | 4c 6f 63 6b 20 3d 20 5f |ontTable|Lock = _|
|00001590| 57 45 53 65 74 48 61 6e | 64 6c 65 4c 6f 63 6b 28 |WESetHan|dleLock(|
|000015a0| 28 48 61 6e 64 6c 65 29 | 68 46 6f 6e 74 54 61 62 |(Handle)|hFontTab|
|000015b0| 6c 65 2c 20 74 72 75 65 | 29 3b 0d 09 70 46 6f 6e |le, true|);..pFon|
|000015c0| 74 54 61 62 6c 65 20 3d | 20 2a 68 46 6f 6e 74 54 |tTable =| *hFontT|
|000015d0| 61 62 6c 65 3b 0d 0d 09 | 2f 2f 09 6d 61 6b 65 20 |able;...|//.make |
|000015e0| 73 75 72 65 20 74 68 65 | 20 66 6f 6e 74 20 74 61 |sure the| font ta|
|000015f0| 62 6c 65 20 69 73 20 61 | 20 72 65 61 73 6f 6e 61 |ble is a| reasona|
|00001600| 62 6c 65 20 73 69 7a 65 | 0d 09 66 6f 6e 74 54 61 |ble size|..fontTa|
|00001610| 62 6c 65 53 69 7a 65 20 | 3d 20 47 65 74 48 61 6e |bleSize |= GetHan|
|00001620| 64 6c 65 53 69 7a 65 28 | 28 48 61 6e 64 6c 65 29 |dleSize(|(Handle)|
|00001630| 68 46 6f 6e 74 54 61 62 | 6c 65 29 3b 0d 09 65 72 |hFontTab|le);..er|
|00001640| 72 20 3d 20 77 65 43 6f | 72 72 75 70 74 44 61 74 |r = weCo|rruptDat|
|00001650| 61 45 72 72 3b 0d 09 69 | 66 20 28 66 6f 6e 74 54 |aErr;..i|f (fontT|
|00001660| 61 62 6c 65 53 69 7a 65 | 20 3c 20 73 69 7a 65 6f |ableSize| < sizeo|
|00001670| 66 28 57 45 46 6f 6e 74 | 54 61 62 6c 65 48 65 61 |f(WEFont|TableHea|
|00001680| 64 65 72 29 29 0d 09 7b | 0d 09 09 67 6f 74 6f 20 |der))..{|...goto |
|00001690| 63 6c 65 61 6e 75 70 3b | 0d 09 7d 0d 0d 09 2f 2f |cleanup;|..}...//|
|000016a0| 09 63 68 65 63 6b 20 66 | 6f 6e 74 20 74 61 62 6c |.check f|ont tabl|
|000016b0| 65 20 73 69 67 6e 61 74 | 75 72 65 0d 09 69 66 20 |e signat|ure..if |
|000016c0| 28 70 46 6f 6e 74 54 61 | 62 6c 65 2d 3e 66 74 48 |(pFontTa|ble->ftH|
|000016d0| 65 61 64 65 72 2e 66 74 | 53 69 67 6e 61 74 75 72 |eader.ft|Signatur|
|000016e0| 65 20 21 3d 20 77 65 46 | 6f 6e 74 54 61 62 6c 65 |e != weF|ontTable|
|000016f0| 53 69 67 6e 61 74 75 72 | 65 29 0d 09 7b 0d 09 09 |Signatur|e)..{...|
|00001700| 67 6f 74 6f 20 63 6c 65 | 61 6e 75 70 3b 0d 09 7d |goto cle|anup;..}|
|00001710| 0d 0d 09 2f 2f 09 63 68 | 65 63 6b 20 66 6f 6e 74 |...//.ch|eck font|
|00001720| 20 74 61 62 6c 65 20 76 | 65 72 73 69 6f 6e 0d 09 | table v|ersion..|
|00001730| 2f 2f 09 61 73 73 75 6d | 65 20 77 65 20 6b 6e 6f |//.assum|e we kno|
|00001740| 77 20 68 6f 77 20 74 6f | 20 68 61 6e 64 6c 65 20 |w how to| handle |
|00001750| 61 6c 6c 20 31 2e 78 20 | 76 65 72 73 69 6f 6e 73 |all 1.x |versions|
|00001760| 0d 09 2f 2f 09 69 66 20 | 61 20 6e 65 77 2c 20 69 |..//.if |a new, i|
|00001770| 6e 63 6f 6d 70 61 74 69 | 62 6c 65 20 66 6f 72 6d |ncompati|ble form|
|00001780| 61 74 20 69 73 20 64 65 | 73 69 67 6e 65 64 20 69 |at is de|signed i|
|00001790| 6e 20 74 68 65 20 66 75 | 74 75 72 65 2c 20 69 74 |n the fu|ture, it|
|000017a0| 20 77 69 6c 6c 0d 09 2f | 2f 09 68 61 76 65 20 74 | will../|/.have t|
|000017b0| 6f 20 62 75 6d 70 20 74 | 68 65 20 76 65 72 73 69 |o bump t|he versi|
|000017c0| 6f 6e 20 6e 75 6d 62 65 | 72 20 74 6f 20 32 2e 78 |on numbe|r to 2.x|
|000017d0| 20 73 6f 20 74 68 69 73 | 20 63 6f 64 65 20 63 61 | so this| code ca|
|000017e0| 6e 20 73 61 66 65 6c 79 | 20 73 6b 69 70 20 69 74 |n safely| skip it|
|000017f0| 0d 09 65 72 72 20 3d 20 | 77 65 4e 65 77 65 72 56 |..err = |weNewerV|
|00001800| 65 72 73 69 6f 6e 45 72 | 72 3b 0d 09 69 66 20 28 |ersionEr|r;..if (|
|00001810| 28 70 46 6f 6e 74 54 61 | 62 6c 65 2d 3e 66 74 48 |(pFontTa|ble->ftH|
|00001820| 65 61 64 65 72 2e 66 74 | 56 65 72 73 69 6f 6e 20 |eader.ft|Version |
|00001830| 26 20 30 78 46 46 30 30 | 30 30 30 30 29 20 21 3d |& 0xFF00|0000) !=|
|00001840| 20 30 78 30 31 30 30 30 | 30 30 30 29 0d 09 7b 0d | 0x01000|000)..{.|
|00001850| 09 09 67 6f 74 6f 20 63 | 6c 65 61 6e 75 70 3b 0d |..goto c|leanup;.|
|00001860| 09 7d 0d 0d 09 2f 2f 09 | 63 68 65 63 6b 20 65 6e |.}...//.|check en|
|00001870| 74 72 79 20 63 6f 75 6e | 74 0d 09 65 72 72 20 3d |try coun|t..err =|
|00001880| 20 77 65 43 6f 72 72 75 | 70 74 44 61 74 61 45 72 | weCorru|ptDataEr|
|00001890| 72 3b 0d 09 69 66 20 28 | 66 6f 6e 74 54 61 62 6c |r;..if (|fontTabl|
|000018a0| 65 53 69 7a 65 20 3c 20 | 73 69 7a 65 6f 66 28 57 |eSize < |sizeof(W|
|000018b0| 45 46 6f 6e 74 54 61 62 | 6c 65 48 65 61 64 65 72 |EFontTab|leHeader|
|000018c0| 29 20 2b 20 73 69 7a 65 | 6f 66 28 57 45 46 6f 6e |) + size|of(WEFon|
|000018d0| 74 54 61 62 6c 65 45 6e | 74 72 79 29 20 2a 20 70 |tTableEn|try) * p|
|000018e0| 46 6f 6e 74 54 61 62 6c | 65 2d 3e 66 74 48 65 61 |FontTabl|e->ftHea|
|000018f0| 64 65 72 2e 66 74 4e 75 | 6d 45 6e 74 72 69 65 73 |der.ftNu|mEntries|
|00001900| 29 0d 09 7b 0d 09 09 67 | 6f 74 6f 20 63 6c 65 61 |)..{...g|oto clea|
|00001910| 6e 75 70 3b 0d 09 7d 0d | 0d 09 2f 2f 09 67 65 74 |nup;..}.|..//.get|
|00001920| 20 6e 61 6d 65 20 6f 66 | 20 73 79 73 74 65 6d 20 | name of| system |
|00001930| 66 6f 6e 74 0d 09 47 65 | 74 46 6f 6e 74 4e 61 6d |font..Ge|tFontNam|
|00001940| 65 28 73 79 73 74 65 6d | 46 6f 6e 74 2c 20 73 79 |e(system|Font, sy|
|00001950| 73 74 65 6d 46 6f 6e 74 | 4e 61 6d 65 29 3b 0d 0d |stemFont|Name);..|
|00001960| 09 2f 2f 09 77 61 6c 6b | 20 74 68 65 20 66 6f 6e |.//.walk| the fon|
|00001970| 74 20 74 61 62 6c 65 0d | 09 66 6f 72 20 28 09 66 |t table.|.for (.f|
|00001980| 6f 6e 74 43 6f 75 6e 74 | 20 3d 20 70 46 6f 6e 74 |ontCount| = pFont|
|00001990| 54 61 62 6c 65 2d 3e 66 | 74 48 65 61 64 65 72 2e |Table->f|tHeader.|
|000019a0| 66 74 4e 75 6d 45 6e 74 | 72 69 65 73 2c 0d 09 09 |ftNumEnt|ries,...|
|000019b0| 09 70 45 6e 74 72 79 20 | 3d 20 26 70 46 6f 6e 74 |.pEntry |= &pFont|
|000019c0| 54 61 62 6c 65 2d 3e 66 | 74 45 6e 74 72 69 65 73 |Table->f|tEntries|
|000019d0| 5b 30 5d 3b 0d 09 09 09 | 66 6f 6e 74 43 6f 75 6e |[0];....|fontCoun|
|000019e0| 74 20 3e 20 30 20 3b 0d | 09 09 09 66 6f 6e 74 43 |t > 0 ;.|...fontC|
|000019f0| 6f 75 6e 74 2d 2d 2c 20 | 70 45 6e 74 72 79 2b 2b |ount--, |pEntry++|
|00001a00| 20 29 0d 09 7b 0d 09 09 | 2f 2f 09 63 61 6c 63 75 | )..{...|//.calcu|
|00001a10| 6c 61 74 65 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |late poi|nter to |
|00001a20| 66 6f 6e 74 20 6e 61 6d | 65 0d 09 09 66 6f 6e 74 |font nam|e...font|
|00001a30| 4e 61 6d 65 20 3d 20 28 | 43 6f 6e 73 74 53 74 72 |Name = (|ConstStr|
|00001a40| 32 35 35 50 61 72 61 6d | 29 20 28 28 28 55 49 6e |255Param|) (((UIn|
|00001a50| 74 33 32 29 20 70 46 6f | 6e 74 54 61 62 6c 65 29 |t32) pFo|ntTable)|
|00001a60| 20 2b 20 70 45 6e 74 72 | 79 2d 3e 66 74 4e 61 6d | + pEntr|y->ftNam|
|00001a70| 65 4f 66 66 73 65 74 29 | 3b 0d 0d 09 09 2f 2f 09 |eOffset)|;....//.|
|00001a80| 62 79 20 64 65 66 61 75 | 6c 74 2c 20 6d 61 70 20 |by defau|lt, map |
|00001a90| 66 6f 6e 74 20 6e 61 6d | 65 20 74 6f 20 66 6f 6e |font nam|e to fon|
|00001aa0| 74 20 49 44 20 75 73 69 | 6e 67 20 47 65 74 46 4e |t ID usi|ng GetFN|
|00001ab0| 75 6d 28 29 0d 09 09 47 | 65 74 46 4e 75 6d 28 66 |um()...G|etFNum(f|
|00001ac0| 6f 6e 74 4e 61 6d 65 2c | 20 26 70 45 6e 74 72 79 |ontName,| &pEntry|
|00001ad0| 2d 3e 66 74 4e 65 77 46 | 6f 6e 74 49 44 29 3b 0d |->ftNewF|ontID);.|
|00001ae0| 0d 09 09 2f 2f 09 47 65 | 74 46 4e 75 6d 28 29 20 |...//.Ge|tFNum() |
|00001af0| 72 65 74 75 72 6e 73 20 | 7a 65 72 6f 20 65 69 74 |returns |zero eit|
|00001b00| 68 65 72 20 62 65 63 61 | 75 73 65 20 74 68 65 20 |her beca|use the |
|00001b10| 73 70 65 63 69 66 69 65 | 64 20 66 6f 6e 74 0d 09 |specifie|d font..|
|00001b20| 09 2f 2f 09 69 73 20 74 | 68 65 20 73 79 73 74 65 |.//.is t|he syste|
|00001b30| 6d 20 66 6f 6e 74 2c 20 | 6f 72 20 62 65 63 61 75 |m font, |or becau|
|00001b40| 73 65 20 69 74 20 64 6f | 65 73 6e 27 74 20 65 78 |se it do|esn't ex|
|00001b50| 69 73 74 0d 09 09 69 66 | 20 28 28 70 45 6e 74 72 |ist...if| ((pEntr|
|00001b60| 79 2d 3e 66 74 4e 65 77 | 46 6f 6e 74 49 44 20 3d |y->ftNew|FontID =|
|00001b70| 3d 20 30 29 20 26 26 20 | 21 45 71 75 61 6c 53 74 |= 0) && |!EqualSt|
|00001b80| 72 69 6e 67 28 66 6f 6e | 74 4e 61 6d 65 2c 20 73 |ring(fon|tName, s|
|00001b90| 79 73 74 65 6d 46 6f 6e | 74 4e 61 6d 65 2c 20 66 |ystemFon|tName, f|
|00001ba0| 61 6c 73 65 2c 20 66 61 | 6c 73 65 29 29 0d 09 09 |alse, fa|lse))...|
|00001bb0| 7b 0d 09 09 09 2f 2f 09 | 6d 69 73 73 69 6e 67 20 |{....//.|missing |
|00001bc0| 66 6f 6e 74 3a 0d 09 09 | 09 2f 2f 09 75 73 65 20 |font:...|.//.use |
|00001bd0| 61 20 72 65 70 6c 61 63 | 65 6d 65 6e 74 20 66 6f |a replac|ement fo|
|00001be0| 6e 74 20 77 69 74 68 20 | 74 68 65 20 73 61 6d 65 |nt with |the same|
|00001bf0| 20 63 68 61 72 61 63 74 | 65 72 20 65 6e 63 6f 64 | charact|er encod|
|00001c00| 69 6e 67 2c 20 69 66 20 | 70 6f 73 73 69 62 6c 65 |ing, if |possible|
|00001c10| 0d 09 09 09 70 45 6e 74 | 72 79 2d 3e 66 74 4e 65 |....pEnt|ry->ftNe|
|00001c20| 77 46 6f 6e 74 49 44 20 | 3d 20 47 65 74 53 63 72 |wFontID |= GetScr|
|00001c30| 69 70 74 56 61 72 69 61 | 62 6c 65 28 47 65 74 53 |iptVaria|ble(GetS|
|00001c40| 63 72 69 70 74 56 61 72 | 69 61 62 6c 65 28 70 45 |criptVar|iable(pE|
|00001c50| 6e 74 72 79 2d 3e 66 74 | 45 6e 63 6f 64 69 6e 67 |ntry->ft|Encoding|
|00001c60| 2c 0d 09 09 09 09 09 09 | 73 6d 45 6e 61 62 6c 65 |,.......|smEnable|
|00001c70| 64 29 20 3f 20 70 45 6e | 74 72 79 2d 3e 66 74 45 |d) ? pEn|try->ftE|
|00001c80| 6e 63 6f 64 69 6e 67 20 | 3a 20 73 6d 53 79 73 74 |ncoding |: smSyst|
|00001c90| 65 6d 53 63 72 69 70 74 | 2c 20 73 6d 53 63 72 69 |emScript|, smScri|
|00001ca0| 70 74 41 70 70 46 6f 6e | 64 29 3b 0d 09 09 7d 0d |ptAppFon|d);...}.|
|00001cb0| 0d 09 09 2f 2f 09 63 61 | 6c 6c 65 72 20 63 61 6e |...//.ca|ller can|
|00001cc0| 20 63 75 73 74 6f 6d 69 | 7a 65 20 74 68 65 20 6e | customi|ze the n|
|00001cd0| 61 6d 65 20 72 65 73 6f | 6c 75 74 69 6f 6e 20 70 |ame reso|lution p|
|00001ce0| 72 6f 63 65 73 73 0d 09 | 09 2f 2f 09 62 79 20 73 |rocess..|.//.by s|
|00001cf0| 70 65 63 69 66 79 69 6e | 67 20 61 20 6d 61 70 70 |pecifyin|g a mapp|
|00001d00| 69 6e 67 20 66 75 6e 63 | 74 69 6f 6e 0d 09 09 69 |ing func|tion...i|
|00001d10| 66 20 28 66 6f 6e 74 4e | 61 6d 65 54 6f 49 44 50 |f (fontN|ameToIDP|
|00001d20| 72 6f 63 20 21 3d 20 6e | 69 6c 29 0d 09 09 7b 0d |roc != n|il)...{.|
|00001d30| 09 09 09 2f 2f 09 6d 61 | 70 20 66 6f 6e 74 20 6e |...//.ma|p font n|
|00001d40| 61 6d 65 20 74 6f 20 66 | 6f 6e 74 20 49 44 20 75 |ame to f|ont ID u|
|00001d50| 73 69 6e 67 20 74 68 65 | 20 73 75 70 70 6c 69 65 |sing the| supplie|
|00001d60| 64 20 6d 61 70 70 69 6e | 67 20 66 75 6e 63 74 69 |d mappin|g functi|
|00001d70| 6f 6e 0d 09 09 09 69 66 | 20 28 28 65 72 72 20 3d |on....if| ((err =|
|00001d80| 20 43 61 6c 6c 57 45 46 | 6f 6e 74 4e 61 6d 65 54 | CallWEF|ontNameT|
|00001d90| 6f 49 44 50 72 6f 63 28 | 66 6f 6e 74 4e 61 6d 65 |oIDProc(|fontName|
|00001da0| 2c 20 70 45 6e 74 72 79 | 2d 3e 66 74 4f 6c 64 46 |, pEntry|->ftOldF|
|00001db0| 6f 6e 74 49 44 2c 20 26 | 70 45 6e 74 72 79 2d 3e |ontID, &|pEntry->|
|00001dc0| 66 74 4e 65 77 46 6f 6e | 74 49 44 2c 20 66 6f 6e |ftNewFon|tID, fon|
|00001dd0| 74 4e 61 6d 65 54 6f 49 | 44 50 72 6f 63 29 29 20 |tNameToI|DProc)) |
|00001de0| 21 3d 20 6e 6f 45 72 72 | 29 0d 09 09 09 7b 0d 09 |!= noErr|)....{..|
|00001df0| 09 09 09 67 6f 74 6f 20 | 63 6c 65 61 6e 75 70 3b |...goto |cleanup;|
|00001e00| 0d 09 09 09 7d 0d 09 09 | 7d 0d 0d 09 09 69 66 20 |....}...|}....if |
|00001e10| 28 70 45 6e 74 72 79 2d | 3e 66 74 4f 6c 64 46 6f |(pEntry-|>ftOldFo|
|00001e20| 6e 74 49 44 20 21 3d 20 | 70 45 6e 74 72 79 2d 3e |ntID != |pEntry->|
|00001e30| 66 74 4e 65 77 46 6f 6e | 74 49 44 29 0d 09 09 7b |ftNewFon|tID)...{|
|00001e40| 0d 09 09 09 63 68 61 6e | 67 65 64 20 3d 20 74 72 |....chan|ged = tr|
|00001e50| 75 65 3b 0d 09 09 7d 0d | 09 7d 09 2f 2f 09 66 6f |ue;...}.|.}.//.fo|
|00001e60| 72 0d 0d 09 2f 2f 09 63 | 6c 65 61 72 20 72 65 73 |r...//.c|lear res|
|00001e70| 75 6c 74 20 63 6f 64 65 | 0d 09 65 72 72 20 3d 20 |ult code|..err = |
|00001e80| 6e 6f 45 72 72 3b 0d 0d | 63 6c 65 61 6e 75 70 3a |noErr;..|cleanup:|
|00001e90| 0d 09 2f 2f 09 75 6e 6c | 6f 63 6b 20 74 68 65 20 |..//.unl|ock the |
|00001ea0| 66 6f 6e 74 20 74 61 62 | 6c 65 0d 09 69 66 20 28 |font tab|le..if (|
|00001eb0| 68 46 6f 6e 74 54 61 62 | 6c 65 20 21 3d 20 6e 69 |hFontTab|le != ni|
|00001ec0| 6c 29 0d 09 7b 0d 09 09 | 5f 57 45 53 65 74 48 61 |l)..{...|_WESetHa|
|00001ed0| 6e 64 6c 65 4c 6f 63 6b | 28 28 48 61 6e 64 6c 65 |ndleLock|((Handle|
|00001ee0| 29 68 46 6f 6e 74 54 61 | 62 6c 65 2c 20 73 61 76 |)hFontTa|ble, sav|
|00001ef0| 65 46 6f 6e 74 54 61 62 | 6c 65 4c 6f 63 6b 29 3b |eFontTab|leLock);|
|00001f00| 0d 09 7d 0d 0d 09 2f 2f | 09 72 65 74 75 72 6e 20 |..}...//|.return |
|00001f10| 77 61 73 43 68 61 6e 67 | 65 64 20 66 6c 61 67 0d |wasChang|ed flag.|
|00001f20| 09 69 66 20 28 77 61 73 | 43 68 61 6e 67 65 64 20 |.if (was|Changed |
|00001f30| 21 3d 20 6e 69 6c 29 0d | 09 7b 0d 09 09 2a 77 61 |!= nil).|.{...*wa|
|00001f40| 73 43 68 61 6e 67 65 64 | 20 3d 20 63 68 61 6e 67 |sChanged| = chang|
|00001f50| 65 64 3b 0d 09 7d 0d 0d | 09 2f 2f 09 72 65 74 75 |ed;..}..|.//.retu|
|00001f60| 72 6e 20 72 65 73 75 6c | 74 20 63 6f 64 65 0d 09 |rn resul|t code..|
|00001f70| 72 65 74 75 72 6e 20 65 | 72 72 3b 0d 7d 0d 0d 70 |return e|rr;.}..p|
|00001f80| 61 73 63 61 6c 20 4f 53 | 45 72 72 20 57 45 55 70 |ascal OS|Err WEUp|
|00001f90| 64 61 74 65 53 74 79 6c | 65 53 63 72 61 70 28 53 |dateStyl|eScrap(S|
|00001fa0| 74 53 63 72 70 48 61 6e | 64 6c 65 20 68 53 74 79 |tScrpHan|dle hSty|
|00001fb0| 6c 65 73 2c 20 57 45 46 | 6f 6e 74 54 61 62 6c 65 |les, WEF|ontTable|
|00001fc0| 48 61 6e 64 6c 65 20 68 | 46 6f 6e 74 54 61 62 6c |Handle h|FontTabl|
|00001fd0| 65 29 0d 7b 0d 09 57 45 | 46 6f 6e 74 54 61 62 6c |e).{..WE|FontTabl|
|00001fe0| 65 50 74 72 20 70 46 6f | 6e 74 54 61 62 6c 65 3b |ePtr pFo|ntTable;|
|00001ff0| 0d 09 57 45 46 6f 6e 74 | 54 61 62 6c 65 45 6e 74 |..WEFont|TableEnt|
|00002000| 72 79 50 74 72 20 70 45 | 6e 74 72 79 3b 0d 09 53 |ryPtr pE|ntry;..S|
|00002010| 63 72 70 53 54 45 6c 65 | 6d 65 6e 74 20 2a 70 53 |crpSTEle|ment *pS|
|00002020| 74 79 6c 65 3b 0d 09 53 | 49 6e 74 33 32 20 66 6f |tyle;..S|Int32 fo|
|00002030| 6e 74 43 6f 75 6e 74 2c | 20 73 74 79 6c 65 43 6f |ntCount,| styleCo|
|00002040| 75 6e 74 3b 0d 09 53 49 | 6e 74 31 36 20 6f 6c 64 |unt;..SI|nt16 old|
|00002050| 46 6f 6e 74 49 44 2c 20 | 6e 65 77 46 6f 6e 74 49 |FontID, |newFontI|
|00002060| 44 3b 0d 0d 09 2f 2f 09 | 74 68 69 73 20 66 75 6e |D;...//.|this fun|
|00002070| 63 74 69 6f 6e 20 64 6f | 65 73 6e 27 74 20 6d 6f |ction do|esn't mo|
|00002080| 76 65 20 6d 65 6d 6f 72 | 79 2c 20 73 6f 20 77 65 |ve memor|y, so we|
|00002090| 20 63 61 6e 0d 09 2f 2f | 09 73 61 66 65 6c 79 20 | can..//|.safely |
|000020a0| 64 65 72 65 66 65 72 65 | 6e 63 65 20 68 46 6f 6e |derefere|nce hFon|
|000020b0| 74 54 61 62 6c 65 20 77 | 69 74 68 6f 75 74 20 6c |tTable w|ithout l|
|000020c0| 6f 63 6b 69 6e 67 20 69 | 74 0d 09 70 46 6f 6e 74 |ocking i|t..pFont|
|000020d0| 54 61 62 6c 65 20 3d 20 | 2a 68 46 6f 6e 74 54 61 |Table = |*hFontTa|
|000020e0| 62 6c 65 3b 0d 0d 09 2f | 2f 09 72 65 6d 61 70 20 |ble;.../|/.remap |
|000020f0| 66 6f 6e 74 20 49 44 73 | 20 69 6e 20 74 68 65 20 |font IDs| in the |
|00002100| 73 74 79 6c 65 20 74 61 | 62 6c 65 20 61 73 73 6f |style ta|ble asso|
|00002110| 63 69 61 74 65 64 20 77 | 69 74 68 20 74 68 65 20 |ciated w|ith the |
|00002120| 73 70 65 63 69 66 69 65 | 64 20 57 45 20 69 6e 73 |specifie|d WE ins|
|00002130| 74 61 6e 63 65 0d 09 66 | 6f 72 20 28 09 66 6f 6e |tance..f|or (.fon|
|00002140| 74 43 6f 75 6e 74 20 3d | 20 70 46 6f 6e 74 54 61 |tCount =| pFontTa|
|00002150| 62 6c 65 2d 3e 66 74 48 | 65 61 64 65 72 2e 66 74 |ble->ftH|eader.ft|
|00002160| 4e 75 6d 45 6e 74 72 69 | 65 73 2c 0d 09 09 09 70 |NumEntri|es,....p|
|00002170| 45 6e 74 72 79 20 3d 20 | 26 70 46 6f 6e 74 54 61 |Entry = |&pFontTa|
|00002180| 62 6c 65 2d 3e 66 74 45 | 6e 74 72 69 65 73 5b 30 |ble->ftE|ntries[0|
|00002190| 5d 3b 0d 09 09 09 66 6f | 6e 74 43 6f 75 6e 74 20 |];....fo|ntCount |
|000021a0| 3e 20 30 20 3b 0d 09 09 | 09 66 6f 6e 74 43 6f 75 |> 0 ;...|.fontCou|
|000021b0| 6e 74 2d 2d 2c 20 70 45 | 6e 74 72 79 2b 2b 20 29 |nt--, pE|ntry++ )|
|000021c0| 0d 09 7b 0d 09 09 6f 6c | 64 46 6f 6e 74 49 44 20 |..{...ol|dFontID |
|000021d0| 3d 20 70 45 6e 74 72 79 | 2d 3e 66 74 4f 6c 64 46 |= pEntry|->ftOldF|
|000021e0| 6f 6e 74 49 44 3b 0d 09 | 09 6e 65 77 46 6f 6e 74 |ontID;..|.newFont|
|000021f0| 49 44 20 3d 20 70 45 6e | 74 72 79 2d 3e 66 74 4e |ID = pEn|try->ftN|
|00002200| 65 77 46 6f 6e 74 49 44 | 3b 0d 0d 09 09 2f 2f 09 |ewFontID|;....//.|
|00002210| 73 6b 69 70 20 69 6e 6e | 65 72 20 6c 6f 6f 70 20 |skip inn|er loop |
|00002220| 69 66 20 74 68 65 72 65 | 27 73 20 6e 6f 74 68 69 |if there|'s nothi|
|00002230| 6e 67 20 74 6f 20 63 68 | 61 6e 67 65 0d 09 09 69 |ng to ch|ange...i|
|00002240| 66 20 28 6f 6c 64 46 6f | 6e 74 49 44 20 3d 3d 20 |f (oldFo|ntID == |
|00002250| 6e 65 77 46 6f 6e 74 49 | 44 29 0d 09 09 7b 0d 09 |newFontI|D)...{..|
|00002260| 09 09 63 6f 6e 74 69 6e | 75 65 3b 0d 09 09 7d 0d |..contin|ue;...}.|
|00002270| 0d 09 09 66 6f 72 20 28 | 09 73 74 79 6c 65 43 6f |...for (|.styleCo|
|00002280| 75 6e 74 20 3d 20 28 2a | 68 53 74 79 6c 65 73 29 |unt = (*|hStyles)|
|00002290| 2d 3e 73 63 72 70 4e 53 | 74 79 6c 65 73 2c 0d 09 |->scrpNS|tyles,..|
|000022a0| 09 09 09 70 53 74 79 6c | 65 20 3d 20 26 20 28 2a |...pStyl|e = & (*|
|000022b0| 68 53 74 79 6c 65 73 29 | 2d 3e 73 63 72 70 53 74 |hStyles)|->scrpSt|
|000022c0| 79 6c 65 54 61 62 5b 30 | 5d 3b 0d 09 09 09 09 73 |yleTab[0|];.....s|
|000022d0| 74 79 6c 65 43 6f 75 6e | 74 20 3e 20 30 3b 0d 09 |tyleCoun|t > 0;..|
|000022e0| 09 09 09 73 74 79 6c 65 | 43 6f 75 6e 74 2d 2d 2c |...style|Count--,|
|000022f0| 20 70 53 74 79 6c 65 2b | 2b 20 29 0d 09 09 7b 0d | pStyle+|+ )...{.|
|00002300| 09 09 09 69 66 20 28 70 | 53 74 79 6c 65 2d 3e 73 |...if (p|Style->s|
|00002310| 63 72 70 46 6f 6e 74 20 | 3d 3d 20 6f 6c 64 46 6f |crpFont |== oldFo|
|00002320| 6e 74 49 44 29 0d 09 09 | 09 7b 0d 09 09 09 09 70 |ntID)...|.{.....p|
|00002330| 53 74 79 6c 65 2d 3e 73 | 63 72 70 46 6f 6e 74 20 |Style->s|crpFont |
|00002340| 3d 20 6e 65 77 46 6f 6e | 74 49 44 3b 0d 09 09 09 |= newFon|tID;....|
|00002350| 7d 0d 09 09 7d 09 2f 2f | 09 66 6f 72 0d 09 7d 09 |}...}.//|.for..}.|
|00002360| 2f 2f 09 66 6f 72 0d 0d | 09 72 65 74 75 72 6e 20 |//.for..|.return |
|00002370| 6e 6f 45 72 72 3b 0d 7d | 0d 00 00 00 00 00 00 00 |noErr;.}|........|
|00002380| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00002390| 00 06 66 00 00 00 00 00 | e0 00 00 00 d0 00 00 f0 |..f.....|........|
|000023a0| 00 06 66 00 00 f0 00 00 | e0 00 00 00 d0 00 00 f0 |..f.....|........|
|000023b0| 0e 57 45 46 6f 6e 74 54 | 61 62 6c 65 73 2e 63 73 |.WEFontT|ables.cs|
|000023c0| 20 44 42 6a 65 63 74 73 | 32 70 65 72 6f 6d 6c 6d | DBjects|2peromlm|
|000023d0| 02 00 54 45 58 54 43 57 | 49 45 01 00 ff ff ff ff |..TEXTCW|IE......|
|000023e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023f0| 00 00 ad 57 9a a8 00 00 | 22 66 00 00 01 ac 00 00 |...W....|"f......|
|00002400| 00 00 00 00 00 00 00 00 | e0 00 00 00 d0 00 00 00 |........|........|
|00002410| 00 00 00 00 00 00 00 00 | e0 00 00 00 d0 00 00 00 |........|........|
|00002420| 00 00 00 00 00 00 00 00 | e0 00 00 00 d0 00 00 00 |........|........|
|00002430| 00 00 00 00 00 00 00 00 | e0 00 00 00 d0 00 00 00 |........|........|
|00002440| 00 00 00 00 00 00 00 00 | e0 00 00 00 d0 00 00 00 |........|........|
|00002450| 00 00 00 00 00 00 00 00 | e0 00 00 00 de ee ee ee |........|........|
|00002460| ee ee ee ee ee ee ee ee | e0 00 00 00 00 40 3f f0 |........|.....@?.|
|00002470| 3f 18 3f 1c 20 1e 20 02 | 20 82 21 c2 22 a2 20 82 |?.?. . .| .!.". .|
|00002480| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00002490| 07 9f d0 a4 03 12 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|000024a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+